public class Text {
    //由于Date是Text 类的非静态内部类，不能直接通过 new Date() 实例化，因此static将其改为静态内部类
    static class Date{
        public int year;
        public int month;   public int day;

        public void setDay(int year,int month,int day){
            this.year = year;
            this.month = month;
            this.day = day;
        }
        public void printDate(){
            System.out.println(this.year + "/" + this.month + "/" + this.day + "/");
        }
    }
    public static void main(String[] args) {
        //构造三个日期类型的对象d1、d2、d3
        Date d1 = new Date();
        Date d2 = new Date();
        Date d3 = new Date();
        //对三个日期进行设置
        d1.setDay(2001,1,12);
        d2.setDay(1998,3,15);
        d3.setDay(1234,4,17);
        //打印
        d1.printDate();
        d2.printDate();
        d3.printDate();
    }
}

    /*public static void main(String[] args) {
        java.util.Date date = new java.util.Date();
        // 得到一个毫秒级别的时间戳
        System.out.println(date.getTime());
    }
}*/
    /*//由于Date是Text 类的非静态内部类，不能直接通过 new Date() 实例化，因此static将其改为静态内部类
    static class Date{
        public int year;
        public int month;
        public int day;

        public void setDay(int y,int m,int d){
            year = y;
            month = m;
            day = d;
        }
        public void printDate(){
            System.out.println(year + "/" + month + "/" + day + "/");
        }
    }
    public static void main(String[] args) {
        //构造三个日期类型的对象d1、d2、d3
        Date d1 = new Date();
        Date d2 = new Date();
        Date d3 = new Date();
        //对三个日期进行设置
        d1.setDay(2001,1,12);
        d2.setDay(1998,3,15);
        d3.setDay(1234,4,17);
        //打印
        d1.printDate();
        d2.printDate();
        d3.printDate();
    }
}*/
    /*public static void main(String[] args) {
        PetDog dogh = new PetDog();//通过new来实例化对象
        dogh.name = "小黄";
        dogh.age = 5;
        dogh.color = "黄色";
        dogh.gender = "male";
        dogh.barks();
        dogh.wag();

        PetDog dogs = new PetDog();
        dogh.name = "小红";
        dogh.age = 3;
        dogh.color = "红色";
        dogh.gender = "female";
        dogh.barks();
        dogh.wag();
    }
}

class PetDog {
    public String name;
    public String color;
    public int age;
    public String gender;

    public void barks() {
        System.out.println(name + "汪汪");
    }

    public void wag() {
        System.out.println(name + "摇尾巴");
    }
}*/
    /*//定义一个学生类
    class Student{
        public String name;
        public String gnder;
        public int age;
        public double score;

        public void Doclass(){
            System.out.println(name + "在上课");
        }
        public void Dohomework(){
            System.out.println(name + "在写作业");
        }
        public void Exam(){
            System.out.println(name + "在考试");
        }
    }*/

   /* //定义一个狗类
    class PetDog{
        public String name;
        public String color;
        public int age;
        public String gender;

        public void barks(){
            System.out.println(name+"汪汪");
        }
        public  void  wag(){
            System.out.println(name + "摇尾巴");
        }
    }*/
  /*  public static void main(String[] args) {

    }
}*/
   /* //for-each语句遍历数组
    public static void main(String[] args) {
        int[] numbers = {1,4,5,2,8,23,4,34,53,45,38};
        //for-each语句
        for(int item:numbers){
            System.out.println("count is:" + item);
        }
    }
}*/